/**
 * 用户(sysUser)
 * 
 * @export
 * @class User
 */
import { Role } from "../entity/role.model";
import { UserProfile } from "../entity/user-profile.model";
import { UserFarm } from "../entity/user-farm.model";
import { Farm } from "../entity/farm.model";

export class User {

    /**
     * 用户ID
     * 
     * @type {number}
     * @memberof User
     */
    public userId?: number;

    /**
     * 用户名
     * 
     * @type {string}
     * @memberof User
     */
    public userName: string;

    /**
     * 用户密码
     * 
     * @type {string}
     * @memberof User
     */
    public passWord: string;

    /**
     * 用户是否启用
     * 
     * @type {boolean}
     * @memberof User
     */
    public unEnabled: boolean;

    /**
     * 用户创建日期
     * 
     * @type {Date}
     * @memberof Usernew
     */
    public dateCreated?: string;

    /**
     * 用户最近修改密码时间
     * 
     * @type {Date}
     * @memberof User
     */
    public dateLastPasswordChange?: string;

    /**
     * 用户最近登录时间
     * 
     * @type {Date}
     * @memberof User
     */
    public dateLastLogin?: string;

    /**
     * 用户最近活动时间
     * 
     * @type {Date}
     * @memberof User
     */
    public dateLastActivity?: string;

    /**
     * 是否选中
     * 
     * @type {boolean}
     * @memberof User
     */
    public isChecked?: boolean = false;

    /**
     * 用户头像
     * 
     * @type {number}
     * @memberof User
     */
    public icon?: string;

    /**
     * 用户姓名
     * 
     * @type {string}
     * @memberof User
     */
    public realName?:string;

    public companyId?:number;
    

    constructor() {
        Object.defineProperty(this, "isChecked", { enumerable: false });
        // Object.defineProperty(this, "icon", { enumerable: false });
        // Object.defineProperty(this, "realName", { enumerable: false });
    }


}

/**
 * 用户管理返回的数据模型
 * 
 * @export
 * @interface UserManage
 */

/**
    export interface UserManage {
        user: User;
        role: Role;
        userProfile: UserProfile;
        userFarm: UserFarm[];  
        isChecked?:boolean;  
    }
*/

export class UserManage {
    constructor(
        public sysUser: User,
        // public role: Role,
        public sysProfile: UserProfile,
        public basicUserFarmList: UserFarm[],
        public farms?:Farm[],
        public roles?:Role[],
        // public isChecked?: boolean
    ) {
        Object.defineProperty(this, "farms", { enumerable: false });
        Object.defineProperty(this, "roles", { enumerable: false });
    }
}


// sysUser  sysProfile  basicUserFarm


// WEBPACK FOOTER //
// ./src/app/entity/user.model.ts